﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/SystemManage/Tenant/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                    $("#form1").find('div.ckbox label').attr('for', '');
                    $("#form1").find('.form-control,input').attr('readonly', 'readonly');
                    $("#form1").find('select').attr('disabled', 'disabled');
                }
            });
        }
    });
    function initControl() {
        $("#EnabledMark").bindSelect();
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/SystemManage/Tenant/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>
<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">
            <tr>
                <th class="formTitle">租户账号</th>
                <td class="formValue">
                    <input id="TenantName" name="TenantName" type="text" class="form-control required" placeholder="请输入微信号" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">租户名称</th>
                <td class="formValue">
                    <input id="FullName" name="FullName" type="text" class="form-control required" placeholder="请输入公众号名称" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">允许登录</th>
                <td class="formValue">
                    <select id="EnabledMark" name="EnabledMark" class="form-control required">
                        <option value="true">是</option>
                        <option value="false">否</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle" valign="top" style="padding-top: 5px;">
                    备注
                </th>
                <td class="formValue">
                    <textarea id="Description" name="Description" class="form-control" style="height: 100px;"></textarea>
                </td>
            </tr>
        </table>
    </div>
</form>